package org.flexqueries2.utils.crypto
{
	import flash.utils.ByteArray;
	
	import mx.utils.Base64Decoder;
	import mx.utils.Base64Encoder;

	public class Base64
	{

		public static function encode(input:String):String
		{
			var enc:Base64Encoder = new Base64Encoder();
			
			enc.encode(input);
			return enc.toString();
		}
		
		public static function decode(input:String):String
		{
			var dec:Base64Decoder = new Base64Decoder();
			
			dec.decode(input);
			var ba:ByteArray = dec.toByteArray();
			return ba.toString();
			
		}
	}
}